//
//  ChatTableViewSelfImageViewCell.swift
//  IMUIDemo
//
//  Created by tbbMacmini on 2025/3/22.
//

import UIKit

class ChatTableViewSelfImageViewCell: UITableViewCell {

    lazy var avatarImageView:UIImageView = {
        let imageView = UIImageView();
        imageView.backgroundColor = UIColor.lightGray
        imageView.layer.cornerRadius = 10
        imageView.layer.masksToBounds = true
        return imageView
    }()
    
    lazy var chatImageView:UIImageView = {
        let imageView = UIImageView();
        imageView.backgroundColor = UIColor.green
        imageView.layer.cornerRadius = 10
        imageView.layer.masksToBounds = true
        return imageView
    }()
    
    
    override func layoutSubviews() {
        super.layoutSubviews();
        setupView()
        
    }
    
    private func setupView() {
        contentView.addSubview(avatarImageView)
        avatarImageView.snp.makeConstraints { make in
            make.top.equalTo(10);
            make.right.equalTo(-10)
            make.size.equalTo(CGSize(width: 44, height: 44));
        }
        
        contentView.addSubview(chatImageView)
        chatImageView.snp.makeConstraints { make in
            make.height.equalTo(chatImageView.snp.width).multipliedBy(0.75)
            make.right.equalTo(avatarImageView.snp.left).offset(-10)
            make.left.greaterThanOrEqualTo(60)
            make.top.equalTo(10);
            make.bottom.equalTo(-10)
        }

    }

}
